package com.gdkj.enums;

/**
 * @author: chenyanqian
 * @date: 2022/11/3
 * @description: 用户达到上限类型枚举
 */
public enum DiggingUserLimitRecordTypeEnums {

    /**
     * 单日填土
     * @author chenyanqian
     * @date 2022/11/3
     */
    FILL_SOIL(1, "单日填土"),

    /**
     * 单日关小黑屋
     * @author chenyanqian
     * @date 2022/11/3
     */
    BLACK_HOUSE(2, "单日关小黑屋");

    /**
     * 类型
     * @author chenyanqian
     * @date 2022/11/3
     */
    private Integer type;

    /**
     * 描述
     * @author chenyanqian
     * @date 2022/11/3
     */
    private String name;

    DiggingUserLimitRecordTypeEnums(Integer type, String name) {
        this.type = type;
        this.name = name;
    }


    /**
     * 根据type获取name值
     * @author chenyanqian
     * @date 2022/11/2
     * @param type : code
     * @return : java.lang.String
     */
    public static String getNameByType(Integer type){
        DiggingUserLimitRecordTypeEnums[] enums = DiggingUserLimitRecordTypeEnums.values();
        for (DiggingUserLimitRecordTypeEnums recordTypeEnums : enums){
            if(recordTypeEnums.type.equals(type)){
                return recordTypeEnums.name;
            }
        }
        return null;
    }
}
